/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.sms.store;

import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.M300;
import queenb.web.util.PackageContants;

/**
 *
 * @author HP
 */
public class M300Store extends M300 {

    public int updateM300(int pnPM3007, int pnFH000, int pnFH200, int pnFN100,Timestamp pdMD301, String pvMV302, String pvMV303, String pvMV304, String pvMV305, String pvMV306, int pnMN314,String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_M300, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPM3007),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.TIMESTAMP, pdMD301),
                        new Param(OracleTypes.CHAR, pvMV302),
                        new Param(OracleTypes.CHAR, pvMV303),
                        new Param(OracleTypes.CHAR, pvMV304),
                        new Param(OracleTypes.CHAR, pvMV305),            
                        new Param(OracleTypes.CHAR, pvMV306),
                          new Param(OracleTypes.INTEGER, pnMN314),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, M300.class);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
    
    public int selectIDM300(String pvPQ250,String pvPQ251,int pnFH000,int pnCount) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.LIST_SELECTID_M300, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.CHAR, pvPQ250),
                        new Param(OracleTypes.CHAR, pvPQ251),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnCount)
                       });
            return super.update(dateStatement, null);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
    

    public List<M300> getListM300(int pnFH000, int pnFH200,int pnFN100,Timestamp pdMD301, String pvMV303, String pvLOGIN) {


        DataStatement dataStatement = new DataStatement(PackageContants.LIST_M300, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                     new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.TIMESTAMP, pdMD301),
                    new Param(OracleTypes.CHAR, pvMV303),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, M300.class);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    public List<M300> getListM300US(int pnFH000,int pnFH200,int pnMN314 ,String pvLOGIN) {


        DataStatement dataStatement = new DataStatement(PackageContants.LIST_M300_US, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                     new Param(OracleTypes.INTEGER, pnMN314),              
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, M300.class);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    public List<M300> getListM300AL(int pnFH000, int pnFH200,int pnFN100,Timestamp pdMD301, String pvMV303, String pvLOGIN) {


        DataStatement dataStatement = new DataStatement(PackageContants.LIST_M300_AL, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                     new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.TIMESTAMP, pdMD301),
                    new Param(OracleTypes.CHAR, pvMV303),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, M300.class);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    public List<M300> getListM300TU(int pnFH000, int pnFH200, Timestamp pdMD301, String pvMV303,String pnPVSEARCH,int offset, int limit, int sort, int direction, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_M300TU, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.TIMESTAMP, pdMD301),
                    new Param(OracleTypes.CHAR, pvMV303),
                     new Param(OracleTypes.CHAR, pnPVSEARCH),
                     new Param(OracleTypes.INTEGER, offset),
                     new Param(OracleTypes.INTEGER, limit),
                     new Param(OracleTypes.INTEGER, sort),
                     new Param(OracleTypes.INTEGER,direction ),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, M300.class);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    public List<M300> getListM300MO(int pnFH000, int pnFH200, Timestamp pdMD301, String pvMV303,String pnPVSEARCH,int offset, int limit, int sort, int direction, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_M300MO, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.TIMESTAMP, pdMD301),
                    new Param(OracleTypes.CHAR, pvMV303),
                     new Param(OracleTypes.CHAR, pnPVSEARCH),
                     new Param(OracleTypes.INTEGER, offset),
                     new Param(OracleTypes.INTEGER, limit),
                     new Param(OracleTypes.INTEGER, sort),
                     new Param(OracleTypes.INTEGER,direction ),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, M300.class);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    public List<M300> getListM300NA(int pnFH000, int pnFH200, Timestamp pdMD301, String pvMV303,String pnPVSEARCH,int offset, int limit, int sort, int direction, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_M300NA, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.TIMESTAMP, pdMD301),
                    new Param(OracleTypes.CHAR, pvMV303),
                     new Param(OracleTypes.CHAR, pnPVSEARCH),
                     new Param(OracleTypes.INTEGER, offset),
                     new Param(OracleTypes.INTEGER, limit),
                     new Param(OracleTypes.INTEGER, sort),
                     new Param(OracleTypes.INTEGER,direction ),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, M300.class);
        } catch (SQLException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M300Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    
}
